/**
 * Created with IDEA
 * author:ju bai
 * Date:2021/3/3
 * Time:16:26
 **/
class Test{
    public void func() {
        System.out.println("fdsafsa");
    }
}
public class TestDemo3 {

    public static void main(String[] args) {
        int a = 100;
        new Test(){
            @Override
            public void func() {
                //a = 999;  匿名内部类当中 变量是不可以改变的
                System.out.println("匿名内部类function！");
                System.out.println("捕获到的变量："+a+"这个变量是不能修改过的!");
            }
        }.func();
    }
}